Skip to content

fix(nebula_hesai): ignore fault message packets in the decoder - #521

Open
Autumn60 wants to merge 1 commit into
tier4:mainfrom
Autumn60:fix/hesai-ignore-fault-messages
Open

Autumn60 wants to merge 1 commit into
tier4:mainfrom
Autumn60:fix/hesai-ignore-fault-messages

Conversation

@Autumn60

@Autumn60 Autumn60 commented Oct 28, 2026 •

Copy link
Copy Markdown

PR Type

  • Bug Fix

Related Links

Description

Some Hesai sensors (e.g. the AT128P) send fault messages to the data port alongside point cloud packets. These packets start with SOP 0xCDDC and are 99 bytes long.

  • Before: HesaiDecoder treated them as truncated point cloud packets. It logged Packet size mismatch: 99 | Expected at least: ... for each one, which is about 200 errors per second per sensor and buries the real errors in the log.
  • After: HesaiDecoder::unpack() checks the SOP first and returns the new DecodeError::PACKET_IGNORED for fault messages, without logging. All other packets are handled as before, so truncated point cloud packets are still reported as PACKET_PARSE_FAILED.

DecodeError::PACKET_IGNORED is meant for any valid packet that carries no point cloud data (e.g. IMU or fault message packets), so other decoders can use it too.

The content of the fault messages is not decoded.

Review Procedure

  1. Build and run the unit tests:

    colcon build --packages-up-to nebula_hesai --cmake-args -DBUILD_TESTING=ON
    colcon test --packages-select nebula_hesai nebula_hesai_decoders nebula_hesai_hw_interfaces
    colcon test-result --verbose

    New test: test_hesai_fault_message feeds a HesaiDecoder<PandarAT128> two packets:

    • A fault message. It must return PACKET_IGNORED and log no error.
    • A truncated point cloud packet. It must still return PACKET_PARSE_FAILED and log one error.

Test results

  • Unit tests: 158 tests in nebula_hesai, nebula_hesai_decoders and nebula_hesai_hw_interfaces pass (ROS 2 Jazzy, Agnocast disabled).
  • pre-commit: passes on all changed files.

Remarks

Pre-Review Checklist for the PR Author

PR Author should check the checkboxes below when creating the PR.

  • Assign PR to reviewer

Checklist for the PR Reviewer

Reviewers should check the checkboxes below before approval.

  • Commits are properly organized and messages are according to the guideline
  • (Optional) Unit tests have been written for new behavior
  • PR title describes the changes

Post-Review Checklist for the PR Author

PR Author should check the checkboxes below before merging.

  • All open points are addressed and tracked via issues or tickets

CI Checks

  • Build and test for PR: Required to pass before the merge.

@Autumn60 Autumn60 mentioned this pull request Oct 28, 2026
1 of 5 tasks
@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45.78%. Comparing base (e32751f) to head (166e2bc).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #521      +/-   ##
==========================================
+ Coverage   45.71%   45.78%   +0.07%     
==========================================
  Files         136      136              
  Lines       10363    10366       +3     
  Branches     1285     1297      +12     
==========================================
+ Hits         4737     4746       +9     
+ Misses       5624     5618       -6     
  Partials        2        2              
Flag Coverage Δ
nebula_hesai 34.57% <100.00%> (?)
nebula_hesai_decoders 34.57% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Autumn60 Autumn60 mentioned this pull request Oct 28, 2026
1 of 5 tasks
@Autumn60
Autumn60 marked this pull request as ready for review October 29, 2026 02:32
@Autumn60
Autumn60 requested a review from mojomex October 29, 2026 02:32
@Autumn60 Autumn60 mentioned this pull request Oct 29, 2026
5 tasks

@mojomex mojomex left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mojomex
mojomex enabled auto-merge (squash) October 29, 2026 03:02
@mojomex
mojomex disabled auto-merge October 29, 2026 03:02
…ponding tests

Signed-off-by: Autum60 <akiro.harada@tier4.jp>
@Autumn60
Autumn60 force-pushed the fix/hesai-ignore-fault-messages branch from 0b2451e to 166e2bc Compare November 2, 2026 00:33

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants